package written.test;

import java.util.Scanner;

/**
 * @Author: Dang Qi
 * @Date: 2021/4/4  20:45
 * @Description:
 */
public class Tencent3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        for(int i = 0; i < T; i++){
            int n =sc.nextInt();
            int w = sc.nextInt();
            int[] a = new int[n];
            int[] b = new int[n];
            for(int j = 0; j < n; j++){
                a[j] = sc.nextInt();
                b[j] = sc.nextInt();
            }
            System.out.println(cal(a, b, w));
        }
    }
    public static int cal(int[] a, int[] b, int w){

        for(int i = 0; i < a.length; i++) {
            a[i] -= b[i];
        }
            
        return -1;
    }
}
